455b8a10b1790a53f8f6b0c9ba808769c885302c,src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java,StaticTypeCheckingVisitor,visitStaticMethodCallExpression,#StaticMethodCallExpression#,907

Before Change


                        // visit the method to obtain inferred return type
                        ClassNode currentClassNode = classNode;
                        classNode = directMethodCallCandidate.getDeclaringClass();
                        visitMethod(directMethodCallCandidate);
                        classNode = currentClassNode;
                        ClassNode returnType = getType(directMethodCallCandidate);
                        if (returnType.isUsingGenerics() && !returnType.isEnum()) {

After Change


                        // visit the method to obtain inferred return type
                        ClassNode currentClassNode = classNode;
                        classNode = directMethodCallCandidate.getDeclaringClass();
                        for (ClassNode node: source.getAST().getClasses()) {
                            if (isClassInnerClassOrEqualTo(classNode, node)) {
                                // visit is authorized because the classnode belongs to the same source unit
                                visitMethod(directMethodCallCandidate);
                                break;
                            }
                        }
                        classNode = currentClassNode;
                        ClassNode returnType = getType(directMethodCallCandidate);